package com.lxd.kyvideo.controller.backend;

import com.lxd.kyvideo.common.ApiResult;
import com.lxd.kyvideo.dto.AdminDTO;
import com.lxd.kyvideo.service.AdminService;
import com.lxd.kyvideo.vo.AdminVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
// http://localhost:8080/api/admin/login
@RequestMapping("/api/manager/admin")
@Api(tags = "系统管理")
public class AdminController {

    @Resource
    private AdminService adminService;




    @PostMapping("/login")
    @ApiOperation("管理员登录")
    public ApiResult login(@RequestBody AdminVO adminVO){
        return adminService.adminLogin(adminVO);
    }

    /*@Resource
    private UserService userService;

    @GetMapping("/queryPage")
    public ApiResult queryPage(Integer page,
                               Integer limit,
                               String name,
                               Integer maxAge,
                               Integer minAge) {
        Page<User> pageInfo = new Page<>(page,limit);
        Page<User> userPage = userService.selectUserPage(pageInfo, name, maxAge, minAge);
        return ApiResult.ok(userPage);
    }


    @GetMapping("/queryList")
    public ApiResult<List<User>> queryList(){
        List<User> list = userService.list();
        return ApiResult.ok(list);
    }

    @GetMapping("/queryById/{id}")
    public ApiResult<User> queryById(@PathVariable Integer id){
        User user = userService.getById(id);
        return ApiResult.ok(user);
    }*/


}
